<legend>Infomation</legend>
      <table width="100%" class="list_info">
        <tr>
          <td style="width:20%; background-color:#EBEBEB">Reply: <?php echo $info["reply_num"]==null ?0:$info["reply_num"];?>| View:<?php echo $info["view"];?></td>
          <td style="width:80%;"><span class="action"><?php 
				$tmpCI = &get_instance();
				if($tmpCI->session->userdata("usertype")== 4){
				echo '<a href="'.base_url("index.php/book/edit/".$info["bookid"]).'">Edit</a>';
				echo ' <a href="'.base_url("index.php/book/delete/".$info["bookid"]).'">Delete</a>';
			}?></span><?php echo $info["book_title"];?></td>
        </tr>
		<tr>
          <td style="width:120px;background-color:#EBEBEB"><?php echo $info["name"];?></td>
          <td><div class="Publish">Publish:<?php echo " ".date('Y-m-d H:i:n',$info["add_date"]);?></div>
          <div class="message"><?php echo  nl2br(htmlspecialchars($info["book_message"]));?></div></td>
        </tr> 
      </table>
	   <?php 
	  if (isset($list))
		{
		?>
	  <table width="100%" class="list_info">
	 <?php
	 $i = 0;
        foreach ($list->result_array() as $row)
		{
			?>		        
		<tr <?php if ($i%2 != 1)echo 'class="bg"';?>>
          <td style="width:20%;background-color:#EBEBEB"><?php echo $row["name"];?></td>
          <td><div class="Publish"><span class="action"><?php 
				$tmpCI = &get_instance();
				if($tmpCI->session->userdata("usertype")== 4){
				//echo '<a href="'.base_url("index.php/book/edit/".$row["rid"]).'">Edit</a>';
				echo ' <a href="'.base_url("index.php/book/delete_reply/".$row["rid"]).'">Delete</a>';
			}?></span>Publish:<?php echo " ".date('Y-m-d H:i:n',$row["re_date"]);?></div>
          <div class="message"><?php echo  nl2br(htmlspecialchars($row["re_message"]));?></div></td>
        </tr> 
		<?php 
		$i++;
		} ?>
      </table>
	  <?php } ?>
	  <div class="f-right" >
	      <span style="width:120px;">
	      <?php 
	      
	      	if (isset($start)&&$start>=10)
	      	{
				$prev =$start-10;
				echo '<a href="'.base_url("index.php/book/detail/".$id."/".$prev).'">prev page</a>';
	      	}
	      	else
	      	{
	      		echo "prev page";
	      	}
	      ?>
	      </span>
	      <span style="width:120px;"><?php if (isset($start))echo ""+($num == 0?0:(intval($start)/10+1))."/".($num%10==0?$num/10:intval($num/10)+1);?>
	      </span>
	      <span style="width:120px;">
	        <?php 
	      	if (isset($start)&&$start+10<=$num)
	      	{
				$next =$start+10;
				echo '<a href="'.base_url("index.php/book/detail/".$id."/".$next).'">next page</a>';
	      	}
	      	else
	      	{
	      		echo "next page";
	      	}
	      ?>
	      </span>
	      </div>
<form id="loginform" name="loginform" action="<?php echo base_url("index.php/book/addreplytomodel")?>" method="post">
<input id="bookid" name ="bookid" type="hidden" value="<?php echo $info["bookid"]; ?>"/>
      <fieldset>
      <legend>Reply</legend>
      <table class="nostyle">
		<tr>
          <td style="width:120px;">Message:</td>
          <td><textarea  id="message" name="message" cols="75" rows="7" class="input-text"></textarea></td>
        </tr> 
        <tr>
          <td colspan="2" class="t-right"><input type="submit" class="input-submit" value="Commit" /></td>
        </tr>
      </table>
      </fieldset>

</form>